package com.zendesk.maxwell.support;

import com.lmax.disruptor.EventHandler;
import com.lmax.disruptor.WorkHandler;

/**
 * @Auther: miaoguoxin
 * @Date: 2021/12/14 17:23
 * @Description:
 */
public class DisruptorEventBus implements EventHandler<DisEvent> {
	private long time;

	public DisruptorEventBus(long time) {
		this.time = time;
	}


	public void setTime(long time) {
		this.time = time;
	}

	@Override
	public void onEvent(DisEvent event, long sequence, boolean endOfBatch) throws Exception {
		if (event.getI() == 100000) {
			System.out.println("线程:"+Thread.currentThread());
			System.out.println(System.currentTimeMillis() - time);
		}
	}
}
